Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD

Class com.pacist.diamonds.PolygonUtil

java.lang.Object
  |
  +--com.pacist.diamonds.PolygonUtil

public class PolygonUtil
extends java.lang.Object
Implements utility functions for polygons.


Method Summary
static java.awt.Polygon reflectPolygon(java.awt.Polygon p, boolean leftRight, boolean topBottom)
          Reflects a polygon across the X and/or Y axis.
static java.awt.Polygon spinPolygon(java.awt.Polygon p, int centreX, int centreY, int count)
          Rotates a polygon count degrees clockwise about the co-ordinates centreX and centreY.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait
 

Method Detail

reflectPolygon

public static java.awt.Polygon reflectPolygon(java.awt.Polygon p,
                                     boolean leftRight,
                                     boolean topBottom)
Reflects a polygon across the X and/or Y axis.
Parameters:
p - the polygon to reflect.
leftRight - true to flip across the Y axis; false otherwise.
topBottom - true to flip across the X axis; false otherwise.
Returns:
Polygon - a new reflected polygon.

spinPolygon

public static java.awt.Polygon spinPolygon(java.awt.Polygon p,
                                  int centreX,
                                  int centreY,
                                  int count)
Rotates a polygon count degrees clockwise about the co-ordinates centreX and centreY.
Parameters:
p - the polygon to rotate.
centreX - the X co-ordinate to rotate around.
centreY - the Y co-ordinate to rotate around.
count - the number of degrees to rotate clockwise.
Returns:
Polygon - the newly rotated polygon.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS | NEXT CLASS FRAMES  | NO FRAMES
SUMMARY:  INNER | FIELD | CONSTR | METHOD DETAIL:  FIELD | CONSTR | METHOD